0 CpxTRS
↳1 TrsToWeightedTrsProof (BOTH BOUNDS(ID, ID), 0 ms)
↳2 CpxWeightedTrs
↳3 InnermostUnusableRulesProof (BOTH BOUNDS(ID, ID), 0 ms)
↳4 CpxWeightedTrs
↳5 TypeInferenceProof (BOTH BOUNDS(ID, ID), 0 ms)
↳6 CpxTypedWeightedTrs
↳7 CompletionProof (UPPER BOUND(ID), 0 ms)
↳8 CpxTypedWeightedCompleteTrs
↳9 CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID), 0 ms)
↳10 CpxRNTS
↳11 CompleteCoflocoProof (⇔, 131 ms)
↳12 BOUNDS(1, n^1)
f(g(X), Y) → f(X, n__f(n__g(X), activate(Y)))
f(X1, X2) → n__f(X1, X2)
g(X) → n__g(X)
activate(n__f(X1, X2)) → f(activate(X1), X2)
activate(n__g(X)) → g(activate(X))
activate(X) → X
f(g(X), Y) → f(X, n__f(n__g(X), activate(Y))) [1]
f(X1, X2) → n__f(X1, X2) [1]
g(X) → n__g(X) [1]
activate(n__f(X1, X2)) → f(activate(X1), X2) [1]
activate(n__g(X)) → g(activate(X)) [1]
activate(X) → X [1]
f(g(X), Y) → f(X, n__f(n__g(X), activate(Y))) [1]
g(X) → n__g(X) [1]
f(X1, X2) → n__f(X1, X2) [1]
g(X) → n__g(X) [1]
activate(n__f(X1, X2)) → f(activate(X1), X2) [1]
activate(n__g(X)) → g(activate(X)) [1]
activate(X) → X [1]
f(X1, X2) → n__f(X1, X2) [1]
g(X) → n__g(X) [1]
activate(n__f(X1, X2)) → f(activate(X1), X2) [1]
activate(n__g(X)) → g(activate(X)) [1]
activate(X) → X [1]
f :: n__f:n__g → a → n__f:n__g n__f :: n__f:n__g → a → n__f:n__g g :: n__f:n__g → n__f:n__g n__g :: n__f:n__g → n__f:n__g activate :: n__f:n__g → n__f:n__g |
const, const1
Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules:
The TRS has the following type information:
Rewrite Strategy: INNERMOST |
const => 0
const1 => 0
activate(z) -{ 1 }→ X :|: X >= 0, z = X
activate(z) -{ 1 }→ g(activate(X)) :|: z = 1 + X, X >= 0
activate(z) -{ 1 }→ f(activate(X1), X2) :|: X1 >= 0, X2 >= 0, z = 1 + X1 + X2
f(z, z') -{ 1 }→ 1 + X1 + X2 :|: X1 >= 0, X2 >= 0, z = X1, z' = X2
g(z) -{ 1 }→ 1 + X :|: X >= 0, z = X
eq(start(V, V1),0,[f(V, V1, Out)],[V >= 0,V1 >= 0]). eq(start(V, V1),0,[g(V, Out)],[V >= 0]). eq(start(V, V1),0,[activate(V, Out)],[V >= 0]). eq(f(V, V1, Out),1,[],[Out = 1 + X11 + X21,X11 >= 0,X21 >= 0,V = X11,V1 = X21]). eq(g(V, Out),1,[],[Out = 1 + X3,X3 >= 0,V = X3]). eq(activate(V, Out),1,[activate(X12, Ret0),f(Ret0, X22, Ret)],[Out = Ret,X12 >= 0,X22 >= 0,V = 1 + X12 + X22]). eq(activate(V, Out),1,[activate(X4, Ret01),g(Ret01, Ret1)],[Out = Ret1,V = 1 + X4,X4 >= 0]). eq(activate(V, Out),1,[],[Out = X5,X5 >= 0,V = X5]). input_output_vars(f(V,V1,Out),[V,V1],[Out]). input_output_vars(g(V,Out),[V],[Out]). input_output_vars(activate(V,Out),[V],[Out]). |
CoFloCo proof output:
Preprocessing Cost Relations
=====================================
#### Computed strongly connected components
0. non_recursive : [f/3]
1. non_recursive : [g/2]
2. recursive [non_tail] : [activate/2]
3. non_recursive : [start/2]
#### Obtained direct recursion through partial evaluation
0. SCC is completely evaluated into other SCCs
1. SCC is completely evaluated into other SCCs
2. SCC is partially evaluated into activate/2
3. SCC is partially evaluated into start/2
Control-Flow Refinement of Cost Relations
=====================================
### Specialization of cost equations activate/2
* CE 5 is refined into CE [6]
* CE 4 is refined into CE [7]
### Cost equations --> "Loop" of activate/2
* CEs [7] --> Loop 4
* CEs [6] --> Loop 5
### Ranking functions of CR activate(V,Out)
* RF of phase [4]: [V]
#### Partial ranking functions of CR activate(V,Out)
* Partial RF of phase [4]:
- RF of loop [4:1]:
V
### Specialization of cost equations start/2
* CE 2 is refined into CE [8]
* CE 3 is refined into CE [9]
### Cost equations --> "Loop" of start/2
* CEs [8,9] --> Loop 6
### Ranking functions of CR start(V,V1)
#### Partial ranking functions of CR start(V,V1)
Computing Bounds
=====================================
#### Cost of chains of activate(V,Out):
* Chain [[4],5]: 2*it(4)+1
Such that:it(4) =< Out
with precondition: [Out=V,Out>=1]
* Chain [5]: 1
with precondition: [V=Out,V>=0]
#### Cost of chains of start(V,V1):
* Chain [6]: 2*s(2)+1
Such that:s(2) =< V
with precondition: [V>=0]
Closed-form bounds of start(V,V1):
-------------------------------------
* Chain [6] with precondition: [V>=0]
- Upper bound: 2*V+1
- Complexity: n
### Maximum cost of start(V,V1): 2*V+1
Asymptotic class: n
* Total analysis performed in 43 ms.